Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: http handler helper #7

Merged
merged 3 commits into from
Jul 26, 2021
Merged

feat: http handler helper #7

merged 3 commits into from
Jul 26, 2021

Conversation

gkatsev
Copy link
Member

@gkatsev gkatsev commented Jul 21, 2021

A helper that properly treats HTTP status codes of 4xx and 5xx as errors and provides the responseBody as a cause on error objects to the provided callback. Otherwise, it'll provide the response body, decoded if requested, to the callback.

Things to iron out:

  • naming. What should this helper be called. How to explain it in docs? It sounds like HttpHandler returns an XhrCallback, based on the type definitions.
  • document this in the README
  • right now, using new JS stuff in the new file, should we add in babel to this repo?

@gkatsev
Copy link
Member Author

gkatsev commented Jul 26, 2021

I'll put the babel stuff in a separate PR.

@gkatsev gkatsev merged commit 5765328 into main Jul 26, 2021
@gkatsev gkatsev deleted the http-handler-helper branch July 26, 2021 20:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants